<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('system_configs', function (Blueprint $table) {
            $table->id();

            $table->string('type')->index()->nullable()->comment('配置type');
            $table->string('key')->unique()->nullable()->comment('配置key');
            $table->text('value')->nullable()->comment('配置value');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `system_configs` comment '系统配置表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('system_configs');
    }
};
